package com.jxb;

import java.util.ArrayList;
import java.util.ServiceLoader;

import org.springframework.context.annotation.DeferredImportSelector;
import org.springframework.core.type.AnnotationMetadata;

/**
 * 类注释
 *
 * @author jiaobo
 * @date Created in 2024/10/3 16:43
 **/
public class BojiaoImportSelect implements DeferredImportSelector {

    @Override
    public String[] selectImports(AnnotationMetadata importingClassMetadata) {
        ServiceLoader<AutoConfiguration> load = ServiceLoader.load(AutoConfiguration.class);
        ArrayList<String> list = new ArrayList<>();
        for (AutoConfiguration configuration : load) {
            list.add(configuration.getClass().getName());
        }

        return list.toArray(new String[0]);
    }
}
